package com.platform.modules.sys.service.impl;


import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.platform.common.utils.Query;
import com.platform.modules.mail.service.MailService;
import com.platform.modules.sys.dao.SysNoticeDao;
import com.platform.modules.sys.entity.SysNoticeEntity;
import com.platform.modules.sys.entity.SysUserEntity;
import com.platform.modules.sys.service.SysDictService;
import com.platform.modules.sys.service.SysNoticeService;
import com.platform.modules.sys.service.SysOrgService;
import com.platform.modules.sys.service.SysOrgUserService;
import com.platform.modules.sys.service.SysRoleService;
import com.platform.modules.sys.service.SysUserRoleService;

/**
 * @author wangLc
 * 2019-09-05
 */
@Service("sysNoticeService")
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeDao, SysNoticeEntity> implements SysNoticeService {
    @Autowired
    private SysUserRoleService sysUserRoleService;
    @Autowired
    private SysRoleService sysRoleService;
    @Autowired
    private SysOrgUserService sysOrgUserService;
    @Autowired
    private MailService mailService;
    @Autowired
    private SysDictService sysDictService;
    @Autowired
    private SysOrgService sysOrgService;

    @Override
    public List<SysNoticeEntity> queryAll(Map<String, Object> params) {
        return baseMapper.queryAll(params);
    }
    
    @Override
    public Page queryPage(Map<String, Object> params) {
        // 排序
        params.put("sidx", "T.CREATE_TIME");
        params.put("asc", false);
        Page<SysNoticeEntity> page = new Query<SysNoticeEntity>(params).getPage();
        List<SysNoticeEntity> noticeList = baseMapper.selectListPage(page, params);
        
        
        return  page.setRecords(noticeList);
    }
   
}
